package com.example.springboot.service;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.springboot.entity.Book;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

public interface IBookService extends IService<Book> {

    boolean save(Book entity);

    boolean updateById(Book entity);

    boolean removeById(Book entity);

    boolean removeBatchByIds(Collection<?> list);

    List<Book> list();

    Book getById(Serializable id);

    <E extends IPage<Book>> E page(E page, Wrapper<Book> queryWrapper);

    List<Book> newBook();

    List<Book> hotBook();

    JSONObject bookCount();

    List<JSONObject> borrowCount();
}

